<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
    	
    }

    public function indexAction()
    {
		//$this->view->xml = simplexml_load_file("https://picasaweb.google.com/data/feed/base/user/113848708930851956597/albumid/5795380358275112865?alt=rss&kind=photo&hl=fr");
		  echo "hy";  	
    }

    public function ecrireAction()
    {
    	$auteur = $this->_getParam('auteur', 0);			
    	$raison = $this->_getParam('raison', 0);			
    	$heure = "maintenant";//new DateTime();
    	
    	$dbU = new Model_DbTable_Flux_Uti();
    	$idU = $dbU->ajouter(array("login"=>$auteur));
    	
    	$dbT = new Model_DbTable_Flux_Tag();
    	$idT = $dbT->ajouter(array("code"=>$raison,"desc"=>"raison"));
    	
    	$dbUT = new Model_DbTable_flux_utitag();
    	$dbUT->ajouter(array("uti_id"=>$idU, "tag_id"=>$idT, "maj"=> new Zend_Db_Expr('NOW()')));
    	
		$this->view->data = $idU." ".$idT." ".$heure; 					
    }

    public function lireAction()
    {
    	$db = new Model_DbTable_Flux_DocTypes();
    	$arr = $db->getAll();
    	$this->view->data = $arr; 					
 
    }
    
}



